package com.ctg.payroll2.service.xlsImport;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ctg.payroll2.bean.po.exceloperator.PayInput;
import com.ctg.payroll2.bean.po.exceloperator.SocialResult;
import com.ctg.platform.util.Page;

/**
 * @author sami
 * 
 */
@SuppressWarnings("unchecked")
public interface XlsImportService<T> {

	/**
	 * 导入对象
	 * 
	 * @param o
	 * @param object
	 */
	public void importData(Object o, Object... object);

	/**
	 * 批量导入
	 * 
	 * @param list
	 */
	public void importDataList(List<T> list);

	/**
	 * 返回导入对象的mapping
	 * 
	 * @param o
	 * @return
	 */
	public HashMap<String, String> getMappingToBean(Object o);

	/**
	 * @param path
	 *            导入路径
	 * @param clazz
	 *            导入对象
	 * @param mapping
	 *            映射关系
	 * @throws Throwable
	 *             异常
	 */
	public Map<String, List> importDataByJxlToBean(String path, Class clazz,
			HashMap<String, String> mapping) throws Throwable;

	/**
	 * @param path
	 *            导入路径
	 * @param mapping
	 *            映射关系
	 * @throws Throwable
	 *             异常
	 */
	public Map<String, List> importDataByJxlToBean(String path,
			HashMap<String, String> mapping) throws Throwable;

	/**
	 * @param parameterObject
	 * @param start
	 * @param limit
	 * @param clazz
	 * @return
	 * @throws Throwable
	 */
	public Page pagedQuery(Map parameterObject, int start, int limit,
			Class clazz) throws Throwable;

	/**
	 * @param o
	 *            删除对象
	 */
	public void deleteTempData(Object o);

	/**
	 * @param o
	 *            数据从临时表到正式表
	 */
	public void insertTmp2Formal(Class o);

	/**
	 * @param o
	 *            数据从临时表到正式表
	 */
	public void insertJTmp2Formal(Class o, HashMap<String, Object> paraMap);

	public Page pagedQuery_temp(Map parameterObject, int start, int limit,
			Class... entityClass);

	/**
	 * xls到数据库
	 * 
	 * @param path
	 * @param mapping
	 */
	public Map<String, List<Map<String, String>>> importDataByJxlToList(
			String path, HashMap<String, String> mapping) throws Throwable;

	public List<HashMap<String, Object>> getDataforMap(Object parameterObject);

	/**
	 * 修改imp_table(薪资导入临时表)的empoyee_id
	 */
	public void update_imp_table();

	public HashMap<String, List> createsql2compensation(Object parameterObject,
			Object payclass_id, String type);

	/**
	 * 创建insert
	 * 
	 * @param list
	 * @return
	 */

	public List<String> createSql(List<Map<String, String>> list);

	/**
	 * 执行本地sql语句
	 * 
	 * @param obj
	 * @return
	 */
	public Object executeSql(Object... obj);

	/**
	 * 导入薪资项目是否唯一,
	 * 
	 * @param paraMap
	 *            条件:employee_id,period,company_code,pay_classitem_id
	 * @return true(imp) , false (can't imp)
	 */
	public Boolean payClassIsOnly(Object paraMap);

	/**
	 * 社保导入是否唯一
	 * 
	 * @param paraMap
	 * @return
	 */
	public Boolean socialIsOnly(Object paraMap);

	/**
	 * 查询该次导入员工是否具有唯一性
	 * 
	 * @param obj
	 * @return
	 */
	public List<Map<String, Object>> isOnlyByempCsCode(Object... obj);

	/**
	 * 雇员导入从临时表到正式表之前修改 政治面貌,部门,婚姻状况等下拉框形式的值为对应数据库的值
	 * 
	 * @return
	 */
	public Integer updateEmpcomboxMapping();

	/**
	 * @param paraMap
	 *            导入的薪资项目,如果有错误数据,允许进行删除
	 * @return
	 */
	public int deletePayInputData(Object paraMap);

	/**
	 * @param paraMap
	 *            导入的社保数据，如果没有缴纳，is_valid＝2，可以进行删除
	 * @return
	 */
	public int deleteSocialResult(Object paraMap);

	/**
	 * 查询导入的薪资项目,companyCode必填, status=1
	 * 
	 * @param paramap
	 * @param start
	 * @param limit
	 * @return
	 */
	public Page queryPayInputData(Object paramap, Integer start,
			Integer limit);

	public Integer queryPayInputDataCount(Object paramap);

	/**
	 * 查询导入的社保项目,data_come=1,companyCode 必填
	 * 
	 * @param paramap
	 * @param start
	 * @param limit
	 * @return
	 */
	public Page querySocialResult(Object paramap, Integer start,
			Integer limit);

	public Integer querySocialResultCount(Object paramap);

	/**
	 * 验证薪资导入接口的内容是否有效,返回一个List<String,Object>.内含无效的接口名字
	 * 
	 * @param paramap
	 *            接口ID,ex_interfaceid
	 * @return
	 */
	public List<HashMap<String, Object>> payClassIsValid(Object paramap);

	/**
	 * 验证社保导入接口的内容是否有效,返回一个List<String,Object>.内含无效的接口名字
	 * 
	 * @param paramap
	 *            接口ID,ex_interfaceid
	 * @return
	 */
	public List<HashMap<String, Object>> socialIsValid(Object paramap);

	/**
	 * 删除创建的表
	 */
	public void droptable();
}
